<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
$CI    = &get_instance();
function _pv( $k )
{
    global $CI;
    return $CI->input->post( $k );
}
function _uk( $n, $default = 0 )
{
    global $CI;
    return $CI->uri->segment( $n , $default ) ;
}
function _ruk($n, $default = 0)
{
    global $CI;
    return $CI->uri->rsegment( $n , $default ) ;
}
function _gc( $key )
{
    global $CI;
    return $CI->config->item( $key );
}
function _gs($key)
{
    global $CI;
    $CI->load->library('session');
	return $CI->session->userdata($key);
}
function _json($data)
{
	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 
	header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); 
	header("Cache-Control: no-cache, must-revalidate" ); 
	header("Pragma: no-cache" );
	header("Content-type: text/x-json");
	die(json_encode($data));
}
function showpage($data = array() , $module = '' , $isshow = true)
{
	global $CI;
	$content	= $CI->load->view('header', $data['header'], true);
	$content	.= $CI->load->view($module, $data['body'], true);
	$content	.= $CI->load->view('footer', '', true);
	if ($isshow == true)
	{
		echo $content;
	}
	else
	{
		return $content;
	}
}